<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>this关键字</title>
    <script>
        function fun() {
            document.write(this.name);
        }
        var obj = {
            name:"飞哥",
            sayName:fun
        };
        obj.sayName();//this指向obj对象
        fun();//this指向window对象
        // 谁调用this指向谁
    </script>
</head>
<body>
    
</body>
</html>